package service.Impl;

import dao.RoomDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Room;
import service.RoomService;
import java.util.List;

@Service
public class RoomServiceImpl implements RoomService {

    @Autowired
    private RoomDao roomDao;

    @Override
    public int insertRoom(Room room) {
        return roomDao.insertRoom(room);
    }

    @Override
    public int deleteRoomById(int roomId) {
        return roomDao.deleteRoomById(roomId);
    }

    @Override
    public int updateRoom(Room room) {
        return roomDao.updateRoom(room);
    }

    @Override
    public Room selectRoomById(int roomId) {
        return roomDao.selectRoomById(roomId);
    }

    @Override
    public List<Room> selectAllRooms() {
        return roomDao.selectAllRooms();
    }

    @Override
    public List<Room> selectRoomsByDepartmentId(int departmentId) {
        return roomDao.selectRoomsByDepartmentId(departmentId);
    }
    @Override
    public List<Room> getRoomsByDepartmentId(Integer departmentId) {
        return roomDao.selectRoomsByDepartmentId(departmentId);
    }
    @Override
    public List<Room> selectRoomsByFloor(int floor) {
        return roomDao.selectRoomsByFloor(floor);
    }
}
